---
layout: "default"
title: "ZipGenerator2"
description: "Swift documentation for 'ZipGenerator2': A generator for the Zip2 sequence."
keywords: "ZipGenerator2,struct,swift,documentation,next,Element"
root: "/v1.2"
---

<div class="intro-declaration"><code class="language-swift">struct ZipGenerator2&lt;E0 : GeneratorType, E1 : GeneratorType&gt;</code></div>

<div class="discussion comment">
    <p>A generator for the <code>Zip2</code> sequence</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">GeneratorType</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>

<tr>
<th id="aliases">Associated Types</th>
<td>
<span id="aliasesmark"></span>
<div class="declaration">
<code class="language-swift">Element = (E0.Element, E1.Element)</code>
<div class="comment">
    <p>The type of element returned by <code>next()</code>.</p>
</div>
</div>
</td>
</tr>


<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>


<h3>Initializers</h3>
<div class="declaration" id="init__">
<a class="toggle-link" data-toggle="collapse" href="#comment-init__">init(<wbr>_:<wbr>_:)</a><div class="comment collapse" id="comment-init__"><div class="p">
    <p>Construct around a pair of underlying generators.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init(_ e0: E0, _ e1: E1)</code>

    </div></div>
</div>





<h3>Instance Methods</h3>
<div class="declaration" id="func-next">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-next">mutating func next()</a>
        
<div class="comment collapse" id="comment-func-next"><div class="p">
    <p>Advance to the next element and return it, or <code>nil</code> if no next
element exists.</p>

<p>Requires: <code>next()</code> has not been applied to a copy of <code>self</code>
since the copy was made, and no preceding call to <code>self.next()</code>
has returned <code>nil</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func next() -&gt; Element?</code>
    
    
</div></div>
</div>


